#ifndef TBLUTIL_H
#define TBLUTIL_H

#include <transact.h>

#define min(x,y)  (((x) < (y)) ? (x) : (y))    /* returns the minimum of two integers */
#define MAX_HOSTS             inGetHDTTotRecs()

#define UPLOAD_NONE	'0'		/* Batch Upload Settings */
#define UPLOAD_LAST	'1'
#define UPLOAD_ALL	'2'

#define TOTAL_ISSUERS   inGetIITTotRecs()

/* Country Codes */
#define USA				        0
#define FRANCE			        1
#define GERMANY			        2
#define UNITED_KINGDOM	        3
#define DENMARK_I		        4
#define SWEDEN			        5
#define ITALY			        6
#define SPAIN			        7
#define JAPAN			        8
#define NORMAY			        9
#define DENMARK_II		        10
#define CHINESE   		        11  /* MULTI_LANG 28-Oct-99 */

#define LANG_INDEX_SIZE             2
#define LANG_NAME_FONT_BYTES_SIZE   16  /* 4 bytes for FontType=0, 8 for FontType=1, 16 for FontType=2 */

/* Font Types */
#define FONT_TYPE_NORMAL            0   /* x = 0-127 chars per font */
#define FONT_TYPE_GRAPHIC_1BYTE     1   /* x = 128-255 chars per font */
#define FONT_TYPE_GRAPHIC_2BYTE     2   /* x = 256-65534 chars per font */

/* String separator character */
#define STRING_SEP_CHAR_NORMAL          '~'
#define STRING_SEP_CHAR_GRAPHIC_1BYTE   0xFE
#define STRING_SEP_CHAR_GRAPHIC_2BYTE   0xFFFE

#define CKRDR_TYPE_NONE     0
#define CKRDR_TYPE_CR600    1
#define CKRDR_TYPE_OTHER    2

#define CKRDR_PORT_RS232    1
#define CKRDR_PORT_PIN_BAR  2
#define CKRDR_PORT_PRINTER  3

#define CKRDR_EXCEPT_NONE   0
#define CKRDR_EXCEPT_ADD    1
#define CKRDR_EXCEPT_CHANGE 2
#define CKRDR_EXCEPT_DELETE 3



int inLoadGetCDTIndex (TRANSACTION_OBJECT *pobTran, char *pchPan);
int inGetCDTTotRecs (void);
int inGetCSTTotRecs (void);
int	inLoadHostData ( int inHostRecNo );
int	inSaveHostData ( int inHostRecNo );
int inGetHDTTotRecs (void);
int inGetIITTotRecs (void);
int inGetIssuerRecord(int inIssuerNumber );
int inGetDefaultLCT(void);
int inGetReceiptLCT(TRANSACTION_OBJECT *pobTran);
int inGetDefaultTemplateName(char *pszTemplateFileName);
int inGetReport1Template(void);
int inGetReport2Template(void);
int inGetReceiptTemplate(TRANSACTION_OBJECT *pobTran);
int inGetLanguageIndex(TRANSACTION_OBJECT *pobTran);
int inSetDefaultLanguage(TRANSACTION_OBJECT *pobTran);
int inGetLCTTotRecs(void);
int inSetLCTTemplateSuffix(char *pszSuffix);
int inBuildLCTPrompt(char *szChoiceMsg);
void vdGetMHTFileName ( char * szFileName);
int inIncSTAN (void);
int inDecSTAN (void);
int inIncHostInvNum (void);
int inResetSeqNum (void);
int inGetMHTTotRecs (void);
int inGetMITTotRecs (void);
int inGetMITIndex(void);
void	vdGetCDTFileName ( char * szFileName);
void	vdGetCSTFileName ( char * szFileName);
int inIncOfflineCount ( void );
int inDecOfflineCount ( void );
int inResetOfflineCount ( void );


#endif

